package com.meitianhui.convenitenbuy.util;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * Empty util
 * Created by Liam on 2018/4/9.
 */
public final class EmptyUtil {

    private EmptyUtil() {
        // prevent from being instantiating.
    }

    public static boolean isEmpty(CharSequence value) {
        return value == null || value.length() == 0;
    }

    public static boolean isEmpty(Map map) {
        return map == null || map.size() == 0;
    }

    public static boolean isEmpty(Set set) {
        return set == null || set.size() == 0;
    }

    public static boolean isEmpty(List list) {
        return list == null || list.size() == 0;
    }

    public static <T> boolean isEmpty(T[] array) {
        return array == null || array.length == 0;
    }

    public static boolean isNotEmpty(CharSequence value) {
        return value != null && value.length() != 0;
    }

    public static boolean isNotEmpty(Map map) {
        return map != null && map.size() != 0;
    }

    public static boolean isNotEmpty(Set set) {
        return set != null && set.size() != 0;
    }

    public static boolean isNotEmpty(List list) {
        return list != null && list.size() != 0;
    }

    public static <T> boolean isNotEmpty(T[] array) {
        return array != null && array.length != 0;
    }

}
